<template>
  <div>
    <swiper :options="swiperOption" ref="mySwiper">
      <!-- slides -->
      <swiper-slide><router-link to="/createShow"><img class="bannerImg" src="http://style.iambuyer.com/img/indexBanner1.png" alt="banner"></router-link></swiper-slide>
      <swiper-slide><router-link to="/createShow"><img class="bannerImg" src="http://style.iambuyer.com/img/indexBanner2.png" alt="banner"></router-link></swiper-slide>
      <swiper-slide><router-link to="/aboutRhx"><img class="bannerImg" src="http://style.iambuyer.com/img/indexBanner3.png" alt="banner"></router-link></swiper-slide>
    </swiper>
  </div>
</template>

<style scoped lang="stylus" rel="stylesheet/stylus">
@import '~common/stylus/index.styl';

.swiper-container {
	height: 170px;
}

.bannerImg {
	width: 100%;
	height: 100%;
}
</style>

<script>
import { swiper, swiperSlide } from "vue-awesome-swiper";
import "swiper/dist/css/swiper.css";
export default {
  name: "globalSwiperBanner",
  components: {
    swiper,
    swiperSlide
  },
  data() {
    return {
      swiperOption: {
        //以下配置不懂的，可以去swiper官网看api，链接http://www.swiper.com.cn/api/
        // notNextTick是一个组件自有属性，如果notNextTick设置为true，组件则不会通过NextTick来实例化swiper，也就意味着你可以在第一时间获取到swiper对象，<br>　　　　　　　　假如你需要刚加载遍使用获取swiper对象来做什么事，那么这个属性一定要是true
        notNextTick: true,
        loop: true,
        // swiper configs 所有的配置同swiper官方api配置
        autoplay: true,
        // direction: "vertical",
        grabCursor: true,
        setWrapperSize: true,
        // autoHeight: true,
        pagination: ".swiper-pagination",
        paginationClickable: true,
        // prevButton: ".swiper-button-prev", //上一张
        // nextButton: ".swiper-button-next", //下一张
        // scrollbar: ".swiper-scrollbar", //滚动条
        mousewheelControl: true,
        observeParents: true,
        // 如果自行设计了插件，那么插件的一些配置相关参数，也应该出现在这个对象中，如下debugger
        debugger: true
      }
    };
  }
};
</script>

